credit2: Introduce a loadavg-based load balancer
authorKeir Fraser <keir@xen.org>
Fri, 24 Dec 2010 08:31:54 +0000 (08:31 +0000)
committerKeir Fraser <keir@xen.org>
Fri, 24 Dec 2010 08:31:54 +0000 (08:31 +0000)
commit32c670623f24f828fd3de2f535784bc336ff8095
tree4fe2c417b54e22370ad147b4dc91e017cf88782a
parentbc24ee57573bc613e428fd3e1f3698807d1700de
credit2: Introduce a loadavg-based load balancer

This is a first-cut at getting load balancing.  I'm first working on
looking at behavior I want to get correct; then, once I know what kind
of behavior works well, then I'll work on getting it efficient.

The general idea is when balancing runqueues, look for the runqueue
whose loadavg is the most different from ours (higher or lower).
Then, look for a transaction which will bring the loads closest
together: either pushing a vcpu, pulling a vcpu, or swapping them.
Use the per-vcpu load to calculate the expected load after the
exchange.

The current algorithm looks at every combination, which is O(N^2).
That's not going to be suitable for workloads with large numbers of
vcpus (such as highly consolidated VDI deployments).  I'll make a more
efficient algorithm once I've experimented and determined what I think
is the best load-balancing behavior.

At the moment, balance from a runqueue every time the credit resets.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
xen/common/sched_credit2.c